package machine;

import java.awt.Color;
import java.awt.Component;
import javax.swing.*;

class MemCellRenderer extends JLabel
    implements ListCellRenderer
{

    public MemCellRenderer()
    {
        setOpaque(true);
    }

    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
    {
        setText(value.toString());
        setBackground(isSelected ? Color.red : Color.white);
        setForeground(isSelected ? Color.white : Color.black);
        return ((Component) (this));
    }
}
